package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Ad entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_AD", schema = "HCD_DEV")
public class Ad extends Entity implements java.io.Serializable {

	// Fields

	private Long adId;
	private Category category;
	private String title;
	private String url;
	private Integer type;
	private Integer devType;
	private Long storeId;
	private String pic;
	private String summary;
	private Boolean status;
	private Long expiredTime;
	private Long addTime;

	// Constructors

	/** default constructor */
	public Ad() {
	}

	/** minimal constructor */
	public Ad(Category category, String title, String url, Integer type, Integer devType,
			Long storeId, Boolean status, Long expiredTime, Long addTime) {
		this.category = category;
		this.title = title;
		this.url = url;
		this.type = type;
		this.devType = devType;
		this.storeId = storeId;
		this.status = status;
		this.expiredTime = expiredTime;
		this.addTime = addTime;
	}

	/** full constructor */
	public Ad(Category category, String title, String url, Integer type, Integer devType,
			Long storeId, String pic, String summary, Boolean status, Long expiredTime, Long addTime) {
		this.category = category;
		this.title = title;
		this.url = url;
		this.type = type;
		this.devType = devType;
		this.storeId = storeId;
		this.pic = pic;
		this.summary = summary;
		this.status = status;
		this.expiredTime = expiredTime;
		this.addTime = addTime;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_AD")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "AD_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getAdId() {
		return this.adId;
	}

	public void setAdId(Long adId) {
		this.adId = adId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CAT_ID", nullable = false)
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@Column(name = "TITLE", nullable = false, length = 200)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "URL", nullable = false, length = 250)
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "TYPE", nullable = false, precision = 2, scale = 0)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "DEV_TYPE", nullable = false, precision = 2, scale = 0)
	public Integer getDevType() {
		return this.devType;
	}

	public void setDevType(Integer devType) {
		this.devType = devType;
	}

	@Column(name = "STORE_ID", nullable = false, precision = 15, scale = 0)
	public Long getStoreId() {
		return this.storeId;
	}

	public void setStoreId(Long storeId) {
		this.storeId = storeId;
	}

	@Column(name = "PIC", length = 250)
	public String getPic() {
		return this.pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	@Column(name = "SUMMARY", length = 500)
	public String getSummary() {
		return this.summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	@Column(name = "STATUS", nullable = false, precision = 1, scale = 0)
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	@Column(name = "EXPIRED_TIME", nullable = false, precision = 15, scale = 0)
	public Long getExpiredTime() {
		return this.expiredTime;
	}

	public void setExpiredTime(Long expiredTime) {
		this.expiredTime = expiredTime;
	}

	@Column(name = "ADD_TIME", nullable = false, precision = 15, scale = 0)
	public Long getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Long addTime) {
		this.addTime = addTime;
	}

}